package cn.edu.scau.cmi.dengzejun.chapter09;

import java.util.*;

public class Example9_11 {
	public static void main(String args[]) {
		System.out.println("please input a line text");
		Scanner scanner = new Scanner(System.in);
		String str = scanner.nextLine();
		String regex = "[\\s\\d\\p{Punt}] +";
		String[] words = str.split(regex);
		for (int i = 0;i<words.length;++i) {
			int m = i+1;
			System.out.println("the word is " + m +" :"+words[i]);
		}
		return;
	}
}
